{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\FEVS_2018.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}17 Jun 2021, 23:14:42

{com}. import delimited "C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\FEVS\FEVS_2010-2019\FEVS_2018_PRDF.csv"
{res}{text}(81 vars, 598,003 obs)

{com}. svyset [pweight=postwt]

      {txt}pweight:{col 16}{res}postwt
          {txt}VCE:{col 16}{res}linearized
  {txt}Single unit:{col 16}{res}missing
     {txt}Strata 1:{col 16}<one>
         SU 1:{col 16}<observations>
        FPC 1:{col 16}<zero>
{p2colreset}{...}

{com}. 
. 
. 
. 
. 
. drop if q17=="X"
{txt}(22,712 observations deleted)

{com}. 
. drop if q17==""
{txt}(2,562 observations deleted)

{com}. 
. drop if q37=="X"
{txt}(25,791 observations deleted)

{com}. 
. drop if q37==""
{txt}(9,739 observations deleted)

{com}. 
. drop if q38=="X"
{txt}(23,064 observations deleted)

{com}. 
. drop if q38==""
{txt}(2,597 observations deleted)

{com}. 
. drop if q15=="X"
{txt}(4,013 observations deleted)

{com}. 
. drop if q15==""
{txt}(1,385 observations deleted)

{com}. 
. drop if q22=="X"
{txt}(18,778 observations deleted)

{com}. 
. drop if q22==""
{txt}(2,597 observations deleted)

{com}. 
. drop if q25=="X"
{txt}(10,687 observations deleted)

{com}. 
. drop if q25==""
{txt}(1,467 observations deleted)

{com}. 
. drop if q33=="X"
{txt}(9,863 observations deleted)

{com}. 
. drop if q33==""
{txt}(1,836 observations deleted)

{com}. 
. drop if q48==.
{txt}(3,658 observations deleted)

{com}. 
. drop if q49==.
{txt}(621 observations deleted)

{com}. 
. 
. 
. destring q17, replace
{txt}q17: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q37, replace
{txt}q37: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q38, replace
{txt}q38: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q15, replace
{txt}q15: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q22, replace
{txt}q22: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q25, replace
{txt}q25: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q33, replace
{txt}q33: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. 
. 
. svy linearized : sem (JUSTICE -> DISTRIBUTIVE, ) (JUSTICE -> PROCEDURAL, ) (JUSTICE -> INTERPERSONAL, ) (DISTRIBUTIVE -> q22, ) (DISTRIBUTIVE -> q25, ) (DISTRIBUTIVE -> q33, ) (PROCEDURAL -> q15, ) (PROCEDURAL -> q17, ) (PROCEDURAL -> q37, ) (PROCEDURAL -> q38, )(INTERPERSONAL -> q48, ) (INTERPERSONAL -> q49, ), standardized latent(JUSTICE DISTRIBUTIVE PROCEDURAL INTERPERSONAL ) nocapslatent
{txt}(running sem on estimation sample)
{res}
{txt}{col 1}Survey: Structural equation model{col 49}Number of obs{col 67}= {res}   456,633
{txt}{col 1}Number of strata{col 22}= {res}        1{txt}{col 49}Population size{col 67}={res}  1,137,572
{txt}{col 1}Number of PSUs{col 22}= {res}  456,633{txt}{col 49}Design df{col 67}= {res}   456,632

{p 0 7}{space 1}{text:( 1)}{space 1} [q22]DISTRIBUTIVE = 1{p_end}
{p 0 7}{space 1}{text:( 2)}{space 1} [q15]PROCEDURAL = 1{p_end}
{p 0 7}{space 1}{text:( 3)}{space 1} [q48]INTERPERSONAL = 1{p_end}
{p 0 7}{space 1}{text:( 4)}{space 1} [DISTRIBUTIVE]JUSTICE = 1{p_end}
{txt}{hline 20}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 21}{c |}{col 33}  Linearized
{col 1}       Standardized{col 21}{c |}      Coef.{col 33}   Std. Err.{col 45}      t{col 53}   P>|t|{col 61}     [95% Con{col 74}f. Interval]
{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}Structural         {col 21}{txt}{c |}
{space 2}{col 3}DISTRIBUTIVE     {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2} .8487625{col 33}{space 2} .0011607{col 44}{space 1}  731.25{col 53}{space 3}0.000{col 61}{space 4} .8464875{col 74}{space 3} .8510374
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}PROCEDURAL       {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2}  .980361{col 33}{space 2} .0012069{col 44}{space 1}  812.31{col 53}{space 3}0.000{col 61}{space 4} .9779955{col 74}{space 3} .9827264
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}INTERPERSONAL    {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2} .6989806{col 33}{space 2} .0013427{col 44}{space 1}  520.59{col 53}{space 3}0.000{col 61}{space 4}  .696349{col 74}{space 3} .7016121
{txt}{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}Measurement        {col 21}{txt}{c |}
{space 2}{col 3}q22              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .8440256{col 33}{space 2} .0008207{col 44}{space 1} 1028.45{col 53}{space 3}0.000{col 61}{space 4} .8424171{col 74}{space 3} .8456341
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.425666{col 33}{space 2}  .003016{col 44}{space 1}  804.27{col 53}{space 3}0.000{col 61}{space 4} 2.419755{col 74}{space 3} 2.431577
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q25              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .8337456{col 33}{space 2} .0008728{col 44}{space 1}  955.31{col 53}{space 3}0.000{col 61}{space 4}  .832035{col 74}{space 3} .8354561
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.593161{col 33}{space 2} .0034761{col 44}{space 1}  746.00{col 53}{space 3}0.000{col 61}{space 4} 2.586348{col 74}{space 3} 2.599974
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q33              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .7261201{col 33}{space 2} .0010993{col 44}{space 1}  660.53{col 53}{space 3}0.000{col 61}{space 4} .7239655{col 74}{space 3} .7282747
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.279128{col 33}{space 2} .0025605{col 44}{space 1}  890.13{col 53}{space 3}0.000{col 61}{space 4}  2.27411{col 74}{space 3} 2.284147
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q15              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .6326835{col 33}{space 2} .0015504{col 44}{space 1}  408.07{col 53}{space 3}0.000{col 61}{space 4} .6296447{col 74}{space 3} .6357223
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.336251{col 33}{space 2} .0056766{col 44}{space 1}  587.72{col 53}{space 3}0.000{col 61}{space 4} 3.325125{col 74}{space 3} 3.347377
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q17              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .7710797{col 33}{space 2} .0010643{col 44}{space 1}  724.47{col 53}{space 3}0.000{col 61}{space 4} .7689936{col 74}{space 3} .7731658
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.053407{col 33}{space 2} .0048966{col 44}{space 1}  623.58{col 53}{space 3}0.000{col 61}{space 4}  3.04381{col 74}{space 3} 3.063004
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q37              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .8343617{col 33}{space 2}  .000941{col 44}{space 1}  886.64{col 53}{space 3}0.000{col 61}{space 4} .8325173{col 74}{space 3} .8362061
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.787534{col 33}{space 2}  .004083{col 44}{space 1}  682.71{col 53}{space 3}0.000{col 61}{space 4} 2.779531{col 74}{space 3} 2.795537
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q38              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .8197353{col 33}{space 2} .0010218{col 44}{space 1}  802.25{col 53}{space 3}0.000{col 61}{space 4} .8177326{col 74}{space 3}  .821738
{txt}{space 14}_cons {c |}{col 21}{res}{space 2}  3.39704{col 33}{space 2} .0058659{col 44}{space 1}  579.12{col 53}{space 3}0.000{col 61}{space 4} 3.385543{col 74}{space 3} 3.408537
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q48              {col 21}{c |}
{space 6}INTERPERSONAL {c |}{col 21}{res}{space 2} .9413887{col 33}{space 2} .0007142{col 44}{space 1} 1318.11{col 53}{space 3}0.000{col 61}{space 4} .9399889{col 74}{space 3} .9427885
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.876293{col 33}{space 2} .0072705{col 44}{space 1}  533.16{col 53}{space 3}0.000{col 61}{space 4} 3.862043{col 74}{space 3} 3.890543
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q49              {col 21}{c |}
{space 6}INTERPERSONAL {c |}{col 21}{res}{space 2} .9165487{col 33}{space 2}  .000777{col 44}{space 1} 1179.66{col 53}{space 3}0.000{col 61}{space 4} .9150259{col 74}{space 3} .9180716
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 4.260259{col 33}{space 2} .0088323{col 44}{space 1}  482.35{col 53}{space 3}0.000{col 61}{space 4} 4.242948{col 74}{space 3}  4.27757
{txt}{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 10}var(e.q22){c |}{col 21}{res}{space 2} .2876208{col 33}{space 2} .0013854{col 61}{space 4} .2849183{col 74}{space 3} .2903489
{txt}{space 10}var(e.q25){c |}{col 21}{res}{space 2} .3048683{col 33}{space 2} .0014553{col 61}{space 4} .3020293{col 74}{space 3} .3077341
{txt}{space 10}var(e.q33){c |}{col 21}{res}{space 2} .4727496{col 33}{space 2} .0015964{col 61}{space 4} .4696309{col 74}{space 3} .4758889
{txt}{space 10}var(e.q15){c |}{col 21}{res}{space 2} .5997116{col 33}{space 2} .0019619{col 61}{space 4} .5958787{col 74}{space 3} .6035692
{txt}{space 10}var(e.q17){c |}{col 21}{res}{space 2} .4054361{col 33}{space 2} .0016414{col 61}{space 4} .4022318{col 74}{space 3} .4086659
{txt}{space 10}var(e.q37){c |}{col 21}{res}{space 2} .3038406{col 33}{space 2} .0015703{col 61}{space 4} .3007783{col 74}{space 3}  .306934
{txt}{space 10}var(e.q38){c |}{col 21}{res}{space 2}  .328034{col 33}{space 2} .0016752{col 61}{space 4} .3247671{col 74}{space 3} .3313339
{txt}{space 10}var(e.q48){c |}{col 21}{res}{space 2} .1137874{col 33}{space 2} .0013447{col 61}{space 4} .1111822{col 74}{space 3} .1164536
{txt}{space 10}var(e.q49){c |}{col 21}{res}{space 2} .1599384{col 33}{space 2} .0014242{col 61}{space 4} .1571712{col 74}{space 3} .1627544
{txt}{space 1}var(e.DISTRIBUTIVE){c |}{col 21}{res}{space 2} .2796023{col 33}{space 2} .0019703{col 61}{space 4}  .275767{col 74}{space 3} .2834908
{txt}{space 3}var(e.PROCEDURAL){c |}{col 21}{res}{space 2} .0388924{col 33}{space 2} .0023664{col 61}{space 4} .0345203{col 74}{space 3} .0438182
{txt}var(e.INTERPERSONAL){c |}{col 21}{res}{space 2} .5114262{col 33}{space 2}  .001877{col 61}{space 4} .5077605{col 74}{space 3} .5151183
{txt}{space 8}var(JUSTICE){c |}{col 21}{res}{space 2}        1{col 33}{space 2}        .{col 61}{space 4}        .{col 74}{space 3}        .
{txt}{hline 20}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. 
. 
. estat gof, stats(all)
{res}
{txt}{hline 21}{c TT}{hline 54}
{lalign 21:Fit statistic}{c |}      Value   Description
{hline 21}{c +}{hline 54}
{lalign 21:Size of residuals}{c |}
{ralign 20:SRMR} {c |} {res}{ralign 10:     0.041}{txt}   Standardized root mean squared residual
{ralign 20:CD} {c |} {res}{ralign 10:     0.966}{txt}   Coefficient of determination
{hline 21}{c BT}{hline 54}
{p 0 2 2 75}Note: model was fit with{txt} svy: prefix; only stats(residuals) valid.{p_end}

{com}. predict justice, latent(JUSTICE)
{res}
{com}. 
. 
. 
. egen average_justice = mean (justice), by (agency)

. 
. 
. 
. egen sub_average_justice = mean (justice), by (level1)

. save "C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\2018FEVS_Justice.dta"
{txt}file C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\2018FEVS_Justice.dta saved

{com}. exit, clear
